package com.party.core.service.main.impl;

import com.party.common.paging.Page;
import com.party.core.dao.read.main.MainViewAnalyzeReadDao;
import com.party.core.dao.write.main.MainViewAnalyzeWriteDao;
import com.party.core.model.BaseModel;
import com.party.core.model.main.MainViewAnalyze;
import com.party.core.service.main.IMainViewAnalyzeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Set;

@Service
public class MainViewAnalyzeService implements IMainViewAnalyzeService {

    @Autowired
    private MainViewAnalyzeWriteDao mainViewAnalyzeWriteDao;
    @Autowired
    private MainViewAnalyzeReadDao mainViewAnalyzeReadDao;

    @Override
    public String insert(MainViewAnalyze mainViewAnalyze) {
        BaseModel.preInsert(mainViewAnalyze);
        boolean result = mainViewAnalyzeWriteDao.insert(mainViewAnalyze);
        if (result) {
            return mainViewAnalyze.getId();
        }
        return null;
    }

    @Override
    public boolean update(MainViewAnalyze mainViewAnalyze) {
        mainViewAnalyze.setUpdateDate(new Date());
        return mainViewAnalyzeWriteDao.update(mainViewAnalyze);
    }

    @Override
    public boolean deleteLogic(String id) {
        return false;
    }

    @Override
    public boolean delete(String id) {
        return mainViewAnalyzeWriteDao.delete(id);
    }

    @Override
    public boolean batchDeleteLogic(Set<String> ids) {
        return false;
    }

    @Override
    public boolean batchDelete(Set<String> ids) {
        return false;
    }

    @Override
    public MainViewAnalyze get(String id) {
        return mainViewAnalyzeReadDao.get(id);
    }

    @Override
    public List<MainViewAnalyze> listPage(MainViewAnalyze mainViewAnalyze, Page page) {
        return null;
    }

    @Override
    public List<MainViewAnalyze> list(MainViewAnalyze mainViewAnalyze) {
        return null;
    }

    @Override
    public List<MainViewAnalyze> batchList(Set<String> ids, MainViewAnalyze mainViewAnalyze, Page page) {
        return null;
    }

    @Override
    public MainViewAnalyze getMainView(MainViewAnalyze MainViewAnalyze) {
        return mainViewAnalyzeReadDao.getMainView(MainViewAnalyze);
    }
}
